from String
Converts a string representation into the corresponding GenderType enum constant.
The conversion is case-insensitive for recognized gender strings.
- "Male" (any case) maps to MALE
- "Female" (any case) maps to FEMALE
- Any other string (including
nullor unrecognized values) maps to UNKNOWN.
Example:
GenderType gender = GenderType.fromString("female"); // gender will be FEMALE
GenderType unknownGender = GenderType.fromString("other"); // unknownGender will be UNKNOWN
Content copied to clipboard
Return
The corresponding GenderType, or UNKNOWN if the string is null or does not match a recognized gender.
Parameters
x
The string to convert. Can be null.